/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"1B50A162-E4C3-4C7B-92B6-C163D115F0E5"}
 */
var fconcepto = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"C88A1CBF-6C2E-41B6-B266-EAB3FB6521C0"}
 */
function Ira_detalle(event) {
	globals.mostrarForm("opago_varios_dtl");
}

/**
 *
 * @properties={typeid:24,uuid:"4CD8D628-085C-4039-926A-930585F9FDF3"}
 * @AllowToRunInFind
 */
function buscar()  
{
	var estado_find = controller.find()
	if (estado_find == false)
	{
		globals.DIALOGS.showWarningDialog('Aviso',"No encontró Pagos Varios (1º find)",'OK')
		return false;
	}
	codigo_movimiento='6...7'   // trae codigo=6=opagos varios y 7= opagos varios negativo
	var Searchdate = utils.dateFormat(globals.gFechaDesde,'dd-MM-yyyy')+'...'+utils.dateFormat(globals.gFechaHasta,'dd-MM-yyyy')
	fecha = '#'+Searchdate +'|dd-MM-yyyy'
	
	if (fconcepto != null)   //  04/03/2013
		concepto='%' + fconcepto + '%'
		
	var found = controller.search()
	if (found == 0)
	{
		globals.DIALOGS.showWarningDialog('Aviso', 'No se encontraron Pagos Varios con esas condiciones','OK')
	}
	else
	{
		foundset.sort('fecha desc, letra asc, sucural asc ,nro_comprobante asc');
	}
	return true
}

/**
 *
 * @properties={typeid:24,uuid:"3F9C0719-D190-4F8E-B041-58739290E2C3"}
 */
function limpiar() {
	fconcepto = null
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"02B63E5A-34A5-4AC2-B2D9-B51BF3812B2C"}
 */
function iniciar(firstShow, event) {
	databaseManager.revertEditedRecords();
	databaseManager.setAutoSave(true);
	limpiar();
	buscar();
}
